<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>jstree.core.js - jstree</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.5 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="jstree.core.js"></a>jstree.<wbr>core.js</h1><div class=CBody><p>The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#jstree.core.js" >jstree.<wbr>core.js</a></td><td class=SDescription>The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.</td></tr><tr class="SGroup"><td class=SEntry><a href="#$.jstree" >$.jstree.</a></td><td class=SDescription>Some static functions and variables, unless you know exactly what you are doing do not use these, but <a href="#$().jstree" class=LGroup id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">$().jstree</a> instead.</td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#$.jstree" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">$.jstree</a></td><td class=SDescription><b>object</b> Contains all static functions and variables used by jstree, some plugins also append variables.</td></tr><tr class="SVariable SIndent1"><td class=SEntry><a href="#$.jstree.IS_IE6" >$.jstree.<wbr>IS_IE6</a></td><td class=SDescription><b>boolean</b> indicating if the client is running Internet Explorer 6</td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#$.jstree.IS_IE7" >$.jstree.<wbr>IS_IE7</a></td><td class=SDescription><b>boolean</b> indicating if the client is running Internet Explorer 7</td></tr><tr class="SVariable SIndent1"><td class=SEntry><a href="#$.jstree.IS_FF2" >$.jstree.<wbr>IS_FF2</a></td><td class=SDescription><b>boolean</b> indicating if the client is running Firefox 2</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#$.jstree.__construct" >$.jstree.<wbr>__construct</a></td><td class=SDescription>Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.</td></tr><tr class="SGroup"><td class=SEntry><a href="#$.jstree" >$.jstree.</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#$.jstree.__destruct" >$.jstree.<wbr>__destruct</a></td><td class=SDescription>Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#$.jstree.__call" >$.jstree.<wbr>__call</a></td><td class=SDescription>Call a function on the instance and return the result</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#$.jstree._reference" >$.jstree.<wbr>_reference</a></td><td class=SDescription>Returns an instance</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#$.jstree._focused" >$.jstree.<wbr>_focused</a></td><td class=SDescription>Returns the currently focused instance (by default once an instance is created it is focused)</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#$.jstree._focus" >$.jstree.<wbr>_focus</a></td><td class=SDescription>Make an instance focused (which defocuses the previously focused instance)</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#$.jstree.plugin" >$.jstree.<wbr>plugin</a></td><td class=SDescription>Register a plugin</td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#$.jstree.defaults" >$.jstree.<wbr>defaults</a></td><td class=SDescription><b>object</b> storing all the default configuration options for every plugin and the core. </td></tr><tr class="SGroup"><td class=SEntry><a href="#$().jstree" >$().jstree()</a></td><td class=SDescription>The actual plugin wrapper, use this to create instances or execute functions on created instances.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#$().jstree" id=link3 onMouseOver="ShowTip(event, 'tt1', 'link3')" onMouseOut="HideTip('tt1')">$().jstree</a></td><td class=SDescription>Creates an instance using the specified objects for containers, or executes a command on an instance, specified by a container.</td></tr><tr class="SGroup"><td class=SEntry><a href="#$.jstree" >$.jstree.</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#$.jstree.SCROLLBAR_WIDTH" id=link4 onMouseOver="ShowTip(event, 'tt3', 'link4')" onMouseOut="HideTip('tt3')">$.jstree.<wbr>SCROLLBAR_WIDTH</a></td><td class=SDescription><b>integer</b> indicating the width of the client scrollbar</td></tr><tr class="SClass"><td class=SEntry><a href="#jstree" >jstree</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#jstree.data" >data</a></td><td class=SDescription><b>object</b> Provides storage for plugins (aside from private variables). </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.get_index" >get_index</a></td><td class=SDescription>Returns an <b>integer</b>, which is the instance&rsquo;s index. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.get_container" >get_container</a></td><td class=SDescription>Returns the jQuery extended container of the tree (the element you used when constructing the tree).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.get_container_ul" >get_container_ul</a></td><td class=SDescription>Returns the jQuery extended first UL node inside the container of the tree.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.get_settings" >get_settings</a></td><td class=SDescription>Returns the settings for the tree.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.__trigger" >__trigger</a></td><td class=SDescription>Used internally to trigger events on the container node.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#jstree.CORE_options" >CORE options</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#jstree.config.core.strings" >config.<wbr>core.<wbr>strings</a></td><td class=SDescription><b>mixed</b> used to store all localization strings. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#jstree.CORE_functions" >CORE functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree._get_string" id=link5 onMouseOver="ShowTip(event, 'tt4', 'link5')" onMouseOut="HideTip('tt4')">_get_string</a></td><td class=SDescription>Used to get the common string in the tree.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.init" >init</a></td><td class=SDescription>Used internally. </td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.__loaded" >__loaded</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when data is first rendered in the tree. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.lock" >lock</a></td><td class=SDescription>Used to lock the tree. </td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.lock" >lock</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when the tree is locked.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.unlock" >unlock</a></td><td class=SDescription>Used to unlock the tree. </td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.unlock" >unlock</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when the tree is unlocked.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.is_locked" id=link6 onMouseOver="ShowTip(event, 'tt5', 'link6')" onMouseOut="HideTip('tt5')">is_locked</a></td><td class=SDescription>Used to get the locked status of the tree.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.get_node" id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">get_node</a></td><td class=SDescription>Get a hold of the LI node (which represents the jstree node).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.get_next" id=link8 onMouseOver="ShowTip(event, 'tt7', 'link8')" onMouseOut="HideTip('tt7')">get_next</a></td><td class=SDescription>Get the next sibling of a node</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.get_prev" id=link9 onMouseOver="ShowTip(event, 'tt8', 'link9')" onMouseOut="HideTip('tt8')">get_prev</a></td><td class=SDescription>Get the previous sibling of a node</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.get_parent" id=link10 onMouseOver="ShowTip(event, 'tt9', 'link10')" onMouseOut="HideTip('tt9')">get_parent</a></td><td class=SDescription>Get the parent of a node</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.get_children" id=link11 onMouseOver="ShowTip(event, 'tt10', 'link11')" onMouseOut="HideTip('tt10')">get_children</a></td><td class=SDescription>Get all the children of a node</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.is_parent" id=link12 onMouseOver="ShowTip(event, 'tt11', 'link12')" onMouseOut="HideTip('tt11')">is_parent</a></td><td class=SDescription>Check if a node is a parent.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.is_loaded" id=link13 onMouseOver="ShowTip(event, 'tt12', 'link13')" onMouseOut="HideTip('tt12')">is_loaded</a></td><td class=SDescription>Check if a node is loaded.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.is_loading" id=link14 onMouseOver="ShowTip(event, 'tt13', 'link14')" onMouseOut="HideTip('tt13')">is_loading</a></td><td class=SDescription>Check if a node is currently loading.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.is_open" id=link15 onMouseOver="ShowTip(event, 'tt14', 'link15')" onMouseOut="HideTip('tt14')">is_open</a></td><td class=SDescription>Check if a node is currently open.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.is_closed" id=link16 onMouseOver="ShowTip(event, 'tt15', 'link16')" onMouseOut="HideTip('tt15')">is_closed</a></td><td class=SDescription>Check if a node is currently closed.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.is_leaf" id=link17 onMouseOver="ShowTip(event, 'tt16', 'link17')" onMouseOut="HideTip('tt16')">is_leaf</a></td><td class=SDescription>Check if a node is a leaf node (has no children).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.load_node" >load_node</a></td><td class=SDescription>Load the children of a node.</td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.load_node" >load_node</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is loaded (succesfully or not).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree._load_node" id=link18 onMouseOver="ShowTip(event, 'tt17', 'link18')" onMouseOut="HideTip('tt17')">_load_node</a></td><td class=SDescription>Load the children of a node, but as opposed to <a href="#jstree.load_node" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt18', 'link19')" onMouseOut="HideTip('tt18')">load_node</a> does not change any visual properties or trigger events. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.open_node" >open_node</a></td><td class=SDescription>Open a node so that its children are visible. </td></tr><tr class="SEvent SIndent2"><td class=SEntry><a href="#jstree.open_node" >open_node</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is successfully opened (but if animation is used this event is triggered BEFORE the animation completes). </td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.__after_open" >__after_open</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is successfully opened AFTER the animation completes). </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.close_node" >close_node</a></td><td class=SDescription>Close a node so that its children are not visible.</td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.close_node" >close_node</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is closed (but if animation is used this event is triggered BEFORE the animation completes). </td></tr><tr class="SEvent SIndent2"><td class=SEntry><a href="#jstree.__after_close" >__after_close</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is closed AFTER the animation completes). </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.toggle_node" id=link20 onMouseOver="ShowTip(event, 'tt19', 'link20')" onMouseOut="HideTip('tt19')">toggle_node</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.open_all" >open_all</a></td><td class=SDescription>Open all nodes from a certain node down.</td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.open_all" >open_all</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when an open_all call completes.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.close_all" >close_all</a></td><td class=SDescription>Close all nodes from a certain node down.</td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#jstree.close_all" >close_all</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a close_all call completes.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jstree.clean_node" id=link21 onMouseOver="ShowTip(event, 'tt20', 'link21')" onMouseOut="HideTip('tt20')">clean_node</a></td><td class=SDescription>This function converts inserted nodes to the required by jsTree format. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jstree.correct_node" >correct_node</a></td><td class=SDescription>This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree). </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="$.jstree"></a>$.jstree.</h3><div class=CBody><p>Some static functions and variables, unless you know exactly what you are doing do not use these, but <a href="#$().jstree" class=LGroup id=link22 onMouseOver="ShowTip(event, 'tt1', 'link22')" onMouseOut="HideTip('tt1')">$().jstree</a> instead.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="$.jstree"></a>$.jstree</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>$.jstree</td></tr></table></blockquote><p><b>object</b> Contains all static functions and variables used by jstree, some plugins also append variables.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="$.jstree.IS_IE6"></a>$.jstree.<wbr>IS_IE6</h3><div class=CBody><p><b>boolean</b> indicating if the client is running Internet Explorer 6</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="$.jstree.IS_IE7"></a>$.jstree.<wbr>IS_IE7</h3><div class=CBody><p><b>boolean</b> indicating if the client is running Internet Explorer 7</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="$.jstree.IS_FF2"></a>$.jstree.<wbr>IS_FF2</h3><div class=CBody><p><b>boolean</b> indicating if the client is running Firefox 2</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$.jstree.__construct"></a>$.jstree.<wbr>__construct</h3><div class=CBody><p>Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.</p><p>`.data(&ldquo;jstree&rdquo;)` is also called on the container and is used for configuration (keep in mind you can specify this data using a &ldquo;data-jstree&rdquo; attribute)</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>container</td><td class=CDLDescription><b>mixed</b> the container of the tree (this should not be the UL node, but a wrapper) - DOM node, jQuery object or selector</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="$.jstree"></a>$.jstree.</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$.jstree.__destruct"></a>$.jstree.<wbr>__destruct</h3><div class=CBody><p>Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>instance</td><td class=CDLDescription><b>mixed</b> the instance to destroy (this argument is passed to <a href="#$.jstree._reference" class=LFunction id=link23 onMouseOver="ShowTip(event, 'tt21', 'link23')" onMouseOut="HideTip('tt21')">$.jstree._reference</a> to get the instance)</td></tr></table><h4 class=CHeading>See also</h4><p><a href="#$.jstree._reference" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt21', 'link24')" onMouseOut="HideTip('tt21')">$.jstree._reference</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$.jstree.__call"></a>$.jstree.<wbr>__call</h3><div class=CBody><p>Call a function on the instance and return the result</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>instance</td><td class=CDLDescription><b>mixed</b> the instance to destroy (this argument is passed to <a href="#$.jstree._reference" class=LFunction id=link25 onMouseOver="ShowTip(event, 'tt21', 'link25')" onMouseOut="HideTip('tt21')">$.jstree._reference</a> to get the instance)</td></tr><tr><td class=CDLEntry>operation</td><td class=CDLDescription><b>string</b> the operation to execute</td></tr><tr><td class=CDLEntry>args</td><td class=CDLDescription><b>array</b> the arguments to pass to the function</td></tr></table><h4 class=CHeading>See also</h4><p><a href="#$.jstree._reference" class=LFunction id=link26 onMouseOver="ShowTip(event, 'tt21', 'link26')" onMouseOut="HideTip('tt21')">$.jstree._reference</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$.jstree._reference"></a>$.jstree.<wbr>_reference</h3><div class=CBody><p>Returns an instance</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>needle</td><td class=CDLDescription><b>mixed</b> - integer, DOM node contained inside a jstree container, ID string, jQuery object, selector</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$.jstree._focused"></a>$.jstree.<wbr>_focused</h3><div class=CBody><p>Returns the currently focused instance (by default once an instance is created it is focused)</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$.jstree._focus"></a>$.jstree.<wbr>_focus</h3><div class=CBody><p>Make an instance focused (which defocuses the previously focused instance)</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>instance</td><td class=CDLDescription><b>mixed</b> the instance to focus (this argument is passed to <a href="#$.jstree._reference" class=LFunction id=link27 onMouseOver="ShowTip(event, 'tt21', 'link27')" onMouseOut="HideTip('tt21')">$.jstree._reference</a> to get the instance)</td></tr></table><h4 class=CHeading>See also</h4><p><a href="#$.jstree._reference" class=LFunction id=link28 onMouseOver="ShowTip(event, 'tt21', 'link28')" onMouseOut="HideTip('tt21')">$.jstree._reference</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$.jstree.plugin"></a>$.jstree.<wbr>plugin</h3><div class=CBody><p>Register a plugin</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>plugin_name</td><td class=CDLDescription><b>string</b> the name of the new plugin (it will be used as a key in an object - make sure it is valid)</td></tr><tr><td class=CDLEntry>plugin_data</td><td class=CDLDescription><b>object</b> consists of 4 keys.&nbsp; Default is:</td></tr></table><blockquote><pre class="prettyprint">{
   __construct : $.noop,   // this function will be executed when a new instance is created
   __destuct   : $.noop,   // this function will be executed when an instance is destroyed
   _fn         : { },      // each key of this object should be a function that will extend the jstree prototype
   defaults    : false     // the default configuration for the plugin (if any)
}</pre></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="$.jstree.defaults"></a>$.jstree.<wbr>defaults</h3><div class=CBody><p><b>object</b> storing all the default configuration options for every plugin and the core.&nbsp; If this is modified all instances created after the modification, which do not explicitly specify some other value will use the new default.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">// this instance will use the _default_ theme
$(&quot;#div0&quot;).jstree({ plugins : [&quot;themes&quot;] });
$.jstree.defaults.themes.theme = &quot;classic&quot;;
// this instance will use the _classic_ theme
$(&quot;#div1&quot;).jstree({ plugins : [&quot;themes&quot;] });
// this instance will use the _apple_ theme
$(&quot;#div2&quot;).jstree({ themes : { &quot;theme&quot; : &quot;apple&quot; }, plugins : [&quot;themes&quot;] });</pre></blockquote></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="$().jstree"></a>$().jstree()</h3><div class=CBody><p>The actual plugin wrapper, use this to create instances or execute functions on created instances.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$().jstree"></a>$().jstree</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>$.fn.jstree = function (</td><td class=PParameter nowrap>settings</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates an instance using the specified objects for containers, or executes a command on an instance, specified by a container.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>settings</td><td class=CDLDescription><b>mixed</b></td></tr></table><ul><li>if you pass an <b>object</b> a new instance will be created (using <a href="#$.jstree.__construct" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt22', 'link29')" onMouseOut="HideTip('tt22')">$.jstree.__construct</a>) for each of the objects in the jquery collection, if an instance already exists on the container it will be destroyed first</li><li>if you pass a <b>string</b> it will be executed using <a href="#$.jstree.__call" class=LFunction id=link30 onMouseOver="ShowTip(event, 'tt23', 'link30')" onMouseOut="HideTip('tt23')">$.jstree.__call</a> on each instance</li></ul><h4 class=CHeading>Examples</h4><blockquote><pre class="prettyprint">// this creates an instance
$(&quot;#some-id&quot;).jstree({
  plugins : [ &quot;html_data&quot;, &quot;themes&quot;, &quot;ui&quot; ]
});

// this executes a function on the instance
$(&quot;#some-id&quot;).jstree(&quot;select_node&quot;, &quot;#the-id-to-select&quot;);</pre></blockquote><h4 class=CHeading>See also</h4><p><a href="#$.jstree.__construct" class=LFunction id=link31 onMouseOver="ShowTip(event, 'tt22', 'link31')" onMouseOut="HideTip('tt22')">$.jstree.__construct</a>, <a href="#$.jstree.__destruct" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt24', 'link32')" onMouseOut="HideTip('tt24')">$.jstree.__destruct</a>, <a href="#$.jstree.__call" class=LFunction id=link33 onMouseOver="ShowTip(event, 'tt23', 'link33')" onMouseOut="HideTip('tt23')">$.jstree.__call</a></p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="$.jstree"></a>$.jstree.</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="$.jstree.SCROLLBAR_WIDTH"></a>$.jstree.<wbr>SCROLLBAR_WIDTH</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>$.jstree.SCROLLBAR_WIDTH</td></tr></table></blockquote><p><b>integer</b> indicating the width of the client scrollbar</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="jstree"></a>jstree</h2><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SVariable"><td class=SEntry><a href="#jstree.data" >data</a></td><td class=SDescription><b>object</b> Provides storage for plugins (aside from private variables). </td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#jstree.get_index" >get_index</a></td><td class=SDescription>Returns an <b>integer</b>, which is the instance&rsquo;s index. </td></tr><tr class="SFunction"><td class=SEntry><a href="#jstree.get_container" >get_container</a></td><td class=SDescription>Returns the jQuery extended container of the tree (the element you used when constructing the tree).</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#jstree.get_container_ul" >get_container_ul</a></td><td class=SDescription>Returns the jQuery extended first UL node inside the container of the tree.</td></tr><tr class="SFunction"><td class=SEntry><a href="#jstree.get_settings" >get_settings</a></td><td class=SDescription>Returns the settings for the tree.</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#jstree.__trigger" >__trigger</a></td><td class=SDescription>Used internally to trigger events on the container node.</td></tr><tr class="SGroup"><td class=SEntry><a href="#jstree.CORE_options" >CORE options</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#jstree.config.core.strings" >config.<wbr>core.<wbr>strings</a></td><td class=SDescription><b>mixed</b> used to store all localization strings. </td></tr><tr class="SGroup"><td class=SEntry><a href="#jstree.CORE_functions" >CORE functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree._get_string" id=link34 onMouseOver="ShowTip(event, 'tt4', 'link34')" onMouseOut="HideTip('tt4')">_get_string</a></td><td class=SDescription>Used to get the common string in the tree.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.init" >init</a></td><td class=SDescription>Used internally. </td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.__loaded" >__loaded</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when data is first rendered in the tree. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.lock" >lock</a></td><td class=SDescription>Used to lock the tree. </td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.lock" >lock</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when the tree is locked.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.unlock" >unlock</a></td><td class=SDescription>Used to unlock the tree. </td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.unlock" >unlock</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when the tree is unlocked.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.is_locked" id=link35 onMouseOver="ShowTip(event, 'tt5', 'link35')" onMouseOut="HideTip('tt5')">is_locked</a></td><td class=SDescription>Used to get the locked status of the tree.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.get_node" id=link36 onMouseOver="ShowTip(event, 'tt6', 'link36')" onMouseOut="HideTip('tt6')">get_node</a></td><td class=SDescription>Get a hold of the LI node (which represents the jstree node).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.get_next" id=link37 onMouseOver="ShowTip(event, 'tt7', 'link37')" onMouseOut="HideTip('tt7')">get_next</a></td><td class=SDescription>Get the next sibling of a node</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.get_prev" id=link38 onMouseOver="ShowTip(event, 'tt8', 'link38')" onMouseOut="HideTip('tt8')">get_prev</a></td><td class=SDescription>Get the previous sibling of a node</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.get_parent" id=link39 onMouseOver="ShowTip(event, 'tt9', 'link39')" onMouseOut="HideTip('tt9')">get_parent</a></td><td class=SDescription>Get the parent of a node</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.get_children" id=link40 onMouseOver="ShowTip(event, 'tt10', 'link40')" onMouseOut="HideTip('tt10')">get_children</a></td><td class=SDescription>Get all the children of a node</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.is_parent" id=link41 onMouseOver="ShowTip(event, 'tt11', 'link41')" onMouseOut="HideTip('tt11')">is_parent</a></td><td class=SDescription>Check if a node is a parent.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.is_loaded" id=link42 onMouseOver="ShowTip(event, 'tt12', 'link42')" onMouseOut="HideTip('tt12')">is_loaded</a></td><td class=SDescription>Check if a node is loaded.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.is_loading" id=link43 onMouseOver="ShowTip(event, 'tt13', 'link43')" onMouseOut="HideTip('tt13')">is_loading</a></td><td class=SDescription>Check if a node is currently loading.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.is_open" id=link44 onMouseOver="ShowTip(event, 'tt14', 'link44')" onMouseOut="HideTip('tt14')">is_open</a></td><td class=SDescription>Check if a node is currently open.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.is_closed" id=link45 onMouseOver="ShowTip(event, 'tt15', 'link45')" onMouseOut="HideTip('tt15')">is_closed</a></td><td class=SDescription>Check if a node is currently closed.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.is_leaf" id=link46 onMouseOver="ShowTip(event, 'tt16', 'link46')" onMouseOut="HideTip('tt16')">is_leaf</a></td><td class=SDescription>Check if a node is a leaf node (has no children).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.load_node" >load_node</a></td><td class=SDescription>Load the children of a node.</td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.load_node" >load_node</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is loaded (succesfully or not).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree._load_node" id=link47 onMouseOver="ShowTip(event, 'tt17', 'link47')" onMouseOut="HideTip('tt17')">_load_node</a></td><td class=SDescription>Load the children of a node, but as opposed to <a href="#jstree.load_node" class=LFunction id=link48 onMouseOver="ShowTip(event, 'tt18', 'link48')" onMouseOut="HideTip('tt18')">load_node</a> does not change any visual properties or trigger events. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.open_node" >open_node</a></td><td class=SDescription>Open a node so that its children are visible. </td></tr><tr class="SEvent SIndent1"><td class=SEntry><a href="#jstree.open_node" >open_node</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is successfully opened (but if animation is used this event is triggered BEFORE the animation completes). </td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.__after_open" >__after_open</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is successfully opened AFTER the animation completes). </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.close_node" >close_node</a></td><td class=SDescription>Close a node so that its children are not visible.</td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.close_node" >close_node</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is closed (but if animation is used this event is triggered BEFORE the animation completes). </td></tr><tr class="SEvent SIndent1"><td class=SEntry><a href="#jstree.__after_close" >__after_close</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a node is closed AFTER the animation completes). </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.toggle_node" id=link49 onMouseOver="ShowTip(event, 'tt19', 'link49')" onMouseOut="HideTip('tt19')">toggle_node</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.open_all" >open_all</a></td><td class=SDescription>Open all nodes from a certain node down.</td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.open_all" >open_all</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when an open_all call completes.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.close_all" >close_all</a></td><td class=SDescription>Close all nodes from a certain node down.</td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#jstree.close_all" >close_all</a></td><td class=SDescription>This event is triggered in the <b>jstree</b> namespace when a close_all call completes.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jstree.clean_node" id=link50 onMouseOver="ShowTip(event, 'tt20', 'link50')" onMouseOut="HideTip('tt20')">clean_node</a></td><td class=SDescription>This function converts inserted nodes to the required by jsTree format. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jstree.correct_node" >correct_node</a></td><td class=SDescription>This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree). </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="jstree.data"></a>data</h3><div class=CBody><p><b>object</b> Provides storage for plugins (aside from private variables).&nbsp; Every plugin has an key in this object.</p><blockquote><pre class="prettyprint">this.data.&lt;plugin_name&gt;;</pre></blockquote><p>This is useful for detecting if some plugin is included in the instance (plugins also use this for dependencies and enhancements).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_index"></a>get_index</h3><div class=CBody><p>Returns an <b>integer</b>, which is the instance&rsquo;s index.&nbsp; Every instance on the page has an unique index, when destroying an intance the index will not be reused.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_container"></a>get_container</h3><div class=CBody><p>Returns the jQuery extended container of the tree (the element you used when constructing the tree).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_container_ul"></a>get_container_ul</h3><div class=CBody><p>Returns the jQuery extended first UL node inside the container of the tree.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_settings"></a>get_settings</h3><div class=CBody><p>Returns the settings for the tree.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>writable</td><td class=CDLDescription><b>boolean</b> whether to return a copy of the settings object or a reference to it.</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;#div1&quot;).jstree(&quot;get_settings&quot;); // will return a copy
$.jstree._reference(&quot;#div1&quot;).get_settings(); // same as above
$.jstree._focused().get_settings(true); // a reference. BE CAREFUL!</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.__trigger"></a>__trigger</h3><div class=CBody><p>Used internally to trigger events on the container node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>event_name</td><td class=CDLDescription>the name of the event to trigger (the <b>jstree</b> namespace will be appended to it)</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>the additional object to pass along with the event.&nbsp; By default <u>data.inst</u> will be the current instance, so when you bind to the event, you can access the instance easily.</td></tr></table><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;some-event.jstree&quot;, function (e, data) { data.inst.some_function(); });</pre></blockquote></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="jstree.CORE_options"></a>CORE options</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="jstree.config.core.strings"></a>config.<wbr>core.<wbr>strings</h3><div class=CBody><p><b>mixed</b> used to store all localization strings.&nbsp; Default is <u>false</u>.</p><h4 class=CHeading>Example 1</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).jstree({
   core : {
       strings : function (s) {
           if(s === &quot;Loading ...&quot;) { s = &quot;Please wait ...&quot;; }
           return s;
       }
   }
});</pre></blockquote><h4 class=CHeading>Example 2</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).jstree({
   core : {
       strings : {
           &quot;Loading ...&quot; : &quot;Please wait ...&quot;
       }
   }
});</pre></blockquote><h4 class=CHeading>See also</h4><p><a href="#jstree._get_string" class=LFunction id=link51 onMouseOver="ShowTip(event, 'tt4', 'link51')" onMouseOut="HideTip('tt4')">_get_string</a></p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="jstree.CORE_functions"></a>CORE functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree._get_string"></a>_get_string</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_get_string : function (</td><td class=PParameter nowrap>s</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Used to get the common string in the tree.</p><p>If <a href="#jstree.config.core.strings" class=LVariable id=link52 onMouseOver="ShowTip(event, 'tt25', 'link52')" onMouseOut="HideTip('tt25')">config.core.strings</a> is set to a function, that function is called with a single parameter (the needed string), the response is returned.</p><p>If <a href="#jstree.config.core.strings" class=LVariable id=link53 onMouseOver="ShowTip(event, 'tt25', 'link53')" onMouseOut="HideTip('tt25')">config.core.strings</a> is set to an object, the key named as the needed string is returned.</p><p>If <a href="#jstree.config.core.strings" class=LVariable id=link54 onMouseOver="ShowTip(event, 'tt25', 'link54')" onMouseOut="HideTip('tt25')">config.core.strings</a> is not set, the the needed string is returned.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>needed_string</td><td class=CDLDescription><b>string</b> the needed string</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.init"></a>init</h3><div class=CBody><p>Used internally.&nbsp; This function is called once the core plugin is constructed.</p><h4 class=CHeading>Triggers</h4><p><a href="#jstree.__loaded" class=LEvent id=link55 onMouseOver="ShowTip(event, 'tt26', 'link55')" onMouseOut="HideTip('tt26')">__loaded</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.__loaded"></a>__loaded</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when data is first rendered in the tree.&nbsp; It won&rsquo;t be triggered after a refresh.&nbsp; Fires only once.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;__loaded.jstree&quot;, function (e, data) { data.inst.do_something(); });</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.lock"></a>lock</h3><div class=CBody><p>Used to lock the tree.&nbsp; When the tree is in a locked state, no functions can be called on the instance (except <a href="#jstree.is_locked" class=LFunction id=link56 onMouseOver="ShowTip(event, 'tt5', 'link56')" onMouseOut="HideTip('tt5')">is_locked</a> and <a href="#jstree.unlock" class=LFunction id=link57 onMouseOver="ShowTip(event, 'tt27', 'link57')" onMouseOut="HideTip('tt27')">unlock</a>).&nbsp; Additionally a <u>jstree-locked</u> class is applied on the container.</p><h4 class=CHeading>Triggers</h4><p><a href="#jstree.lock" class=LFunction id=link58 onMouseOver="ShowTip(event, 'tt28', 'link58')" onMouseOut="HideTip('tt28')">lock</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.lock"></a>lock</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when the tree is locked.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.args</td><td class=CDLDescription><b>array</b> the arguments passed to the function</td></tr><tr><td class=CDLEntry>data.plugin</td><td class=CDLDescription><b>string</b> the function&rsquo;s plugin (here it will be <u>&rdquo;core&rdquo;</u> but if the function is extended it may be something else).</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><u>null</u></td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;lock.jstree&quot;, function (e, data) { data.inst.do_something(); });</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.unlock"></a>unlock</h3><div class=CBody><p>Used to unlock the tree.&nbsp; Instance can be used normally again.&nbsp; The <u>jstree-locked</u> class is removed from the container.</p><h4 class=CHeading>Triggers</h4><p><a href="#jstree.unlock" class=LFunction id=link59 onMouseOver="ShowTip(event, 'tt27', 'link59')" onMouseOut="HideTip('tt27')">unlock</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.unlock"></a>unlock</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when the tree is unlocked.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.args</td><td class=CDLDescription><b>array</b> the arguments passed to the function</td></tr><tr><td class=CDLEntry>data.plugin</td><td class=CDLDescription><b>string</b> the function&rsquo;s plugin (here it will be <u>&rdquo;core&rdquo;</u> but if the function is extended it may be something else).</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><u>null</u></td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;unlock.jstree&quot;, function (e, data) { data.inst.do_something(); });</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.is_locked"></a>is_locked</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>is_locked : function ()</td></tr></table></blockquote><p>Used to get the locked status of the tree.</p><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>locked</td><td class=CDLDescription><b>boolean</b> <u>true</u> if tree is locked, <u>false</u> otherwise</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_node"></a>get_node</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_node : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get a hold of the LI node (which represents the jstree node).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jquery collection</td><td class=CDLDescription>node was found, the collection contains the LI node</td></tr><tr><td class=CDLEntry>-1</td><td class=CDLDescription>the tree container was referenced</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription>on failure (obj is not part of a tree, or does not exists in the DOM)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_next"></a>get_next</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_next : function (</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>strict</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the next sibling of a node</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr><tr><td class=CDLEntry>strict</td><td class=CDLDescription><b>boolean</b> if set to <u>true</u> jstree will only return immediate siblings, otherwise, if <u>obj</u> is the last child of its parent, the parent&rsquo;s next sibling is returned.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jquery collection</td><td class=CDLDescription>node was found, the collection contains the LI node</td></tr><tr><td class=CDLEntry>-1</td><td class=CDLDescription>the tree container was referenced</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription>node was not found, or failure (obj is not part of a tree, or does not exists in the DOM)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_prev"></a>get_prev</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_prev : function (</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>strict</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the previous sibling of a node</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr><tr><td class=CDLEntry>strict</td><td class=CDLDescription><b>boolean</b> if set to <u>true</u> jstree will only return immediate siblings, otherwise, if <u>obj</u> is the first child of its parent, the parent&rsquo;s previous sibling is returned.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jquery collection</td><td class=CDLDescription>node was found, the collection contains the LI node</td></tr><tr><td class=CDLEntry>-1</td><td class=CDLDescription>the tree container was referenced</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription>node was not found, or failure (obj is not part of a tree, or does not exists in the DOM)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_parent"></a>get_parent</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_parent : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the parent of a node</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jquery collection</td><td class=CDLDescription>node was found, the collection contains the LI node</td></tr><tr><td class=CDLEntry>-1</td><td class=CDLDescription>when <u>obj</u> was a root node</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription>on failure (obj is not part of a tree, or does not exists in the DOM)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.get_children"></a>get_children</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_children : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get all the children of a node</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.&nbsp; If <u>-1</u> is used all root nodes are returned.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jquery collection</td><td class=CDLDescription>node was found, the collection contains the LI nodes of all immediate children</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription>on failure (obj is not part of a tree, or does not exists in the DOM)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.is_parent"></a>is_parent</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_parent : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if a node is a parent.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>true</td><td class=CDLDescription><u>obj</u> has children or is closed (will be loaded)</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription><u>obj</u> is not a valid node or has no children (leaf node)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.is_loaded"></a>is_loaded</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_loaded : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if a node is loaded.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>true</td><td class=CDLDescription><u>obj</u> has children or is leaf</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription><u>obj</u> is currently loading or is not a leaf, but has no children</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.is_loading"></a>is_loading</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_loading : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if a node is currently loading.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>true</td><td class=CDLDescription><u>obj</u> is currently loading</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription><u>obj</u> is not currently loading</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.is_open"></a>is_open</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_open : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if a node is currently open.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>true</td><td class=CDLDescription><u>obj</u> is currently open</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription><u>obj</u> is not currently open</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.is_closed"></a>is_closed</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_closed : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if a node is currently closed.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>true</td><td class=CDLDescription><u>obj</u> is currently closed</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription><u>obj</u> is not currently closed</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.is_leaf"></a>is_leaf</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_leaf : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if a node is a leaf node (has no children).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>true</td><td class=CDLDescription><u>obj</u> is a leaf node</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription><u>obj</u> is not a leaf node</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.load_node"></a>load_node</h3><div class=CBody><p>Load the children of a node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.&nbsp; Use -1 to load the root nodes.</td></tr><tr><td class=CDLEntry>callback</td><td class=CDLDescription>a function to be executed in the tree&rsquo;s scope.&nbsp; Receives two arguments: <u>obj</u> (the same node used to call load_node), <u>status</u> (a boolean indicating if the node was loaded successfully.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>true</td><td class=CDLDescription><u>obj</u> is a valid node and will try loading it</td></tr><tr><td class=CDLEntry>false</td><td class=CDLDescription><u>obj</u> is not a valid node</td></tr></table><h4 class=CHeading>Triggers</h4><p><a href="#jstree.load_node" class=LFunction id=link60 onMouseOver="ShowTip(event, 'tt18', 'link60')" onMouseOut="HideTip('tt18')">load_node</a></p><h4 class=CHeading>See also</h4><p><a href="#jstree._load_node" class=LFunction id=link61 onMouseOver="ShowTip(event, 'tt17', 'link61')" onMouseOut="HideTip('tt17')">_load_node</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.load_node"></a>load_node</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when a node is loaded (succesfully or not).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.args</td><td class=CDLDescription><b>array</b> the arguments passed to the function</td></tr><tr><td class=CDLEntry>data.plugin</td><td class=CDLDescription><b>string</b> the function&rsquo;s plugin (here it will be <u>&rdquo;core&rdquo;</u> but if the function is extended it may be something else).</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><b>object</b> which contains two keys <u>obj</u> (the loaded node) and <u>status</u> - whether the node was loaded successfully.</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;load_node.jstree&quot;, function (e, data) { if(data.rslt.status) { data.inst.open_node(data.rslt.obj); } });</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree._load_node"></a>_load_node</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_load_node : function (</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>callback</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Load the children of a node, but as opposed to <a href="#jstree.load_node" class=LFunction id=link62 onMouseOver="ShowTip(event, 'tt18', 'link62')" onMouseOut="HideTip('tt18')">load_node</a> does not change any visual properties or trigger events.&nbsp; This function is used in <a href="#jstree.load_node" class=LFunction id=link63 onMouseOver="ShowTip(event, 'tt18', 'link63')" onMouseOut="HideTip('tt18')">load_node</a> internally.&nbsp; The idea is for data source plugins to overwrite this function.&nbsp; This implementation (from the <b>core</b>) only uses markup found in the tree container, and does not load async.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.&nbsp; Use -1 to load the root nodes.</td></tr><tr><td class=CDLEntry>callback</td><td class=CDLDescription>a function to be executed in the tree&rsquo;s scope.&nbsp; Receives one argument: <u>status</u> (a boolean indicating if the node was loaded successfully).</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.open_node"></a>open_node</h3><div class=CBody><p>Open a node so that its children are visible.&nbsp; If the node is not loaded try loading it first.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr><tr><td class=CDLEntry>callback</td><td class=CDLDescription>a function to be executed in the tree&rsquo;s scope.&nbsp; Receives two arguments: <u>obj</u> (the node being opened) and <u>status</u> (a boolean indicating if the node was opened successfully).</td></tr><tr><td class=CDLEntry>animation</td><td class=CDLDescription>the duration in miliseconds of the slideDown animation.&nbsp; If not supplied the jQuery default is used.&nbsp; Please note that on IE6 a <u>0</u> is enforced here due to performance issues.</td></tr></table><h4 class=CHeading>Triggers</h4><p><a href="#jstree.open_node" class=LFunction id=link64 onMouseOver="ShowTip(event, 'tt29', 'link64')" onMouseOut="HideTip('tt29')">open_node</a>, <a href="#jstree.__after_open" class=LEvent id=link65 onMouseOver="ShowTip(event, 'tt30', 'link65')" onMouseOut="HideTip('tt30')">__after_open</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.open_node"></a>open_node</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when a node is successfully opened (but if animation is used this event is triggered BEFORE the animation completes).&nbsp; See <a href="#jstree.__after_open" class=LEvent id=link66 onMouseOver="ShowTip(event, 'tt30', 'link66')" onMouseOut="HideTip('tt30')">__after_open</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.args</td><td class=CDLDescription><b>array</b> the arguments passed to the function</td></tr><tr><td class=CDLEntry>data.plugin</td><td class=CDLDescription><b>string</b> the function&rsquo;s plugin (here it will be <u>&rdquo;core&rdquo;</u> but if the function is extended it may be something else).</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><b>object</b> which contains a single key: <u>obj</u> (the opened node).</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;open_node.jstree&quot;, function (e, data) {
  data.rslt.obj.find('&gt; ul &gt; .jstree-closed').each(function () {
    data.inst.open_node(this);
  }
});</pre></blockquote></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.__after_open"></a>__after_open</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when a node is successfully opened AFTER the animation completes).&nbsp; See <a href="#jstree.open_node" class=LFunction id=link67 onMouseOver="ShowTip(event, 'tt29', 'link67')" onMouseOut="HideTip('tt29')">open_node</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><b>object</b> which contains a single key: <u>obj</u> (the opened node).</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;__after_open.jstree&quot;, function (e, data) {
  data.rslt.obj.find('&gt; ul &gt; .jstree-closed').each(function () {
    data.inst.open_node(this);
  }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.close_node"></a>close_node</h3><div class=CBody><p>Close a node so that its children are not visible.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr><tr><td class=CDLEntry>animation</td><td class=CDLDescription>the duration in miliseconds of the slideDown animation.&nbsp; If not supplied the jQuery default is used.&nbsp; Please note that on IE6 a <u>0</u> is enforced here due to performance issues.</td></tr></table><h4 class=CHeading>Triggers</h4><p><a href="#jstree.close_node" class=LFunction id=link68 onMouseOver="ShowTip(event, 'tt31', 'link68')" onMouseOut="HideTip('tt31')">close_node</a>, <a href="#jstree.__after_close" class=LEvent id=link69 onMouseOver="ShowTip(event, 'tt32', 'link69')" onMouseOut="HideTip('tt32')">__after_close</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.close_node"></a>close_node</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when a node is closed (but if animation is used this event is triggered BEFORE the animation completes).&nbsp; See <a href="#jstree.__after_close" class=LEvent id=link70 onMouseOver="ShowTip(event, 'tt32', 'link70')" onMouseOut="HideTip('tt32')">__after_close</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.args</td><td class=CDLDescription><b>array</b> the arguments passed to the function</td></tr><tr><td class=CDLEntry>data.plugin</td><td class=CDLDescription><b>string</b> the function&rsquo;s plugin (here it will be <u>&rdquo;core&rdquo;</u> but if the function is extended it may be something else).</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><b>object</b> which contains a single key: <u>obj</u> (the closed node).</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;close_node.jstree&quot;, function (e, data) {
  data.rslt.obj.children('ul').remove();
});</pre></blockquote></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.__after_close"></a>__after_close</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when a node is closed AFTER the animation completes).&nbsp; See <a href="#jstree.close_node" class=LFunction id=link71 onMouseOver="ShowTip(event, 'tt31', 'link71')" onMouseOut="HideTip('tt31')">close_node</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><b>object</b> which contains a single key: <u>obj</u> (the opened node).</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;__after_close.jstree&quot;, function (e, data) {
  data.rslt.obj.children('ul').remove();
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.toggle_node"></a>toggle_node</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>toggle_node : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>If a node is closed</td><td class=CDLDescription>open it, if it is open - close it.</td></tr></table><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.open_all"></a>open_all</h3><div class=CBody><p>Open all nodes from a certain node down.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.&nbsp; If <u>-1</u> is used or is omitted all nodes in the tree are opened.</td></tr><tr><td class=CDLEntry>animation</td><td class=CDLDescription>the duration of the slideDown animation when opening the nodes.&nbsp; If not set <u>0</u> is enforced for performance issues.</td></tr><tr><td class=CDLEntry>original_obj</td><td class=CDLDescription>used internally to keep track of the recursion - do not set manually!</td></tr></table><h4 class=CHeading>Triggers</h4><p><a href="#jstree.open_all" class=LFunction id=link72 onMouseOver="ShowTip(event, 'tt33', 'link72')" onMouseOut="HideTip('tt33')">open_all</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.open_all"></a>open_all</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when an open_all call completes.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.args</td><td class=CDLDescription><b>array</b> the arguments passed to the function</td></tr><tr><td class=CDLEntry>data.plugin</td><td class=CDLDescription><b>string</b> the function&rsquo;s plugin (here it will be <u>&rdquo;core&rdquo;</u> but if the function is extended it may be something else).</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><b>object</b> which contains a single key: <u>obj</u> (the node used in the call).</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;open_all.jstree&quot;, function (e, data) {
  alert('DONE');
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.close_all"></a>close_all</h3><div class=CBody><p>Close all nodes from a certain node down.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.&nbsp; If <u>-1</u> is used or is omitted all nodes in the tree are closed.</td></tr><tr><td class=CDLEntry>animation</td><td class=CDLDescription>the duration of the slideDown animation when closing the nodes.&nbsp; If not set <u>0</u> is enforced for performance issues.</td></tr></table><h4 class=CHeading>Triggers</h4><p><a href="#jstree.close_all" class=LFunction id=link73 onMouseOver="ShowTip(event, 'tt34', 'link73')" onMouseOut="HideTip('tt34')">close_all</a></p></div></div></div>

<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="jstree.close_all"></a>close_all</h3><div class=CBody><p>This event is triggered in the <b>jstree</b> namespace when a close_all call completes.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data.inst</td><td class=CDLDescription>the instance</td></tr><tr><td class=CDLEntry>data.args</td><td class=CDLDescription><b>array</b> the arguments passed to the function</td></tr><tr><td class=CDLEntry>data.plugin</td><td class=CDLDescription><b>string</b> the function&rsquo;s plugin (here it will be <u>&rdquo;core&rdquo;</u> but if the function is extended it may be something else).</td></tr><tr><td class=CDLEntry>data.rslt</td><td class=CDLDescription><b>object</b> which contains a single key: <u>obj</u> (the node used in the call).</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$(&quot;div&quot;).bind(&quot;close_all.jstree&quot;, function (e, data) {
  alert('DONE');
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.clean_node"></a>clean_node</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>clean_node : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>This function converts inserted nodes to the required by jsTree format.&nbsp; It takes care of converting a simple unodreder list to the internally used markup.&nbsp; The core calls this function automatically when new data arrives (by binding to the <a href="#jstree.load_node" class=LFunction id=link74 onMouseOver="ShowTip(event, 'tt18', 'link74')" onMouseOut="HideTip('tt18')">load_node</a> event).&nbsp; Each plugin may override this function to include its own markup, but keep in mind to do it like that:</p><blockquote><pre class="prettyprint">clean_node : function(obj) {
 obj = this.__call_old();
 obj.each(function () {
   // do your stuff here
 });
}</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.&nbsp; If <u>-1</u> is used or is omitted all nodes in the tree are cleaned.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jQuery collection</td><td class=CDLDescription>the cleaned children of the original node.</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jstree.correct_node"></a>correct_node</h3><div class=CBody><p>This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).&nbsp; The core calls this function automatically when a node is opened, deleted or moved.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription><b>mixed</b> this is used as a jquery selector - can be jQuery object, DOM node, string, etc.&nbsp; If <u>-1</u> is used or is omitted the root nodes are processed.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jQuery collection</td><td class=CDLDescription>the processed children of the original node.</td></tr></table></div></div></div>

</div><!--Content-->


<div id=Footer>Copyright &copy; 2010 Ivan Bozhanov&nbsp; &middot;&nbsp; Updated March 20th, 2011&nbsp; &middot;&nbsp; <a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MTitle>jstree<div class=MSubTitle>jquery treeview plugin</div></div><div class=MEntry><div class=MFile><a href="_usage-txt.html">USAGE</a></div></div><div class=MEntry><div class=MFile><a href="_license-txt.html">LICENSE</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Core</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile id=MSelected>jstree.<wbr>core.js</div></div><div class=MEntry><div class=MFile><a href="vakata-js.html">Helper functions</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Plugins</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="jstree-themes-js.html">jstree.<wbr>themes.js</a></div></div><div class=MEntry><div class=MFile><a href="jstree-ui-js.html">jstree.<wbr>ui.js</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="_lib/jquery-js.html">_lib\<wbr>jquery.js</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Index</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Events.html">Events</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Events">Events</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CGroup>The actual plugin wrapper, use this to create instances or execute functions on created instances.</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>$.jstree</td></tr></table></blockquote><b>object</b> Contains all static functions and variables used by jstree, some plugins also append variables.</div></div><div class=CToolTip id="tt3"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>$.jstree.SCROLLBAR_WIDTH</td></tr></table></blockquote><b>integer</b> indicating the width of the client scrollbar</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_get_string : function (</td><td class=PParameter nowrap>s</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Used to get the common string in the tree.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>is_locked : function ()</td></tr></table></blockquote>Used to get the locked status of the tree.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_node : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get a hold of the LI node (which represents the jstree node).</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_next : function (</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>strict</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the next sibling of a node</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_prev : function (</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>strict</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the previous sibling of a node</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_parent : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the parent of a node</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get_children : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get all the children of a node</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_parent : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if a node is a parent.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_loaded : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if a node is loaded.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_loading : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if a node is currently loading.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_open : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if a node is currently open.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_closed : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if a node is currently closed.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>is_leaf : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if a node is a leaf node (has no children).</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_load_node : function (</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>callback</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Load the children of a node, but as opposed to load_node does not change any visual properties or trigger events. </div></div><div class=CToolTip id="tt18"><div class=CFunction>Load the children of a node.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>toggle_node : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>clean_node : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>This function converts inserted nodes to the required by jsTree format. </div></div><div class=CToolTip id="tt21"><div class=CFunction>Returns an instance</div></div><div class=CToolTip id="tt22"><div class=CFunction>Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.</div></div><div class=CToolTip id="tt23"><div class=CFunction>Call a function on the instance and return the result</div></div><div class=CToolTip id="tt24"><div class=CFunction>Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace</div></div><div class=CToolTip id="tt25"><div class=CVariable><b>mixed</b> used to store all localization strings. </div></div><div class=CToolTip id="tt26"><div class=CEvent>This event is triggered in the <b>jstree</b> namespace when data is first rendered in the tree. </div></div><div class=CToolTip id="tt27"><div class=CFunction>Used to unlock the tree. </div></div><div class=CToolTip id="tt28"><div class=CFunction>Used to lock the tree. </div></div><div class=CToolTip id="tt29"><div class=CFunction>Open a node so that its children are visible. </div></div><div class=CToolTip id="tt30"><div class=CEvent>This event is triggered in the <b>jstree</b> namespace when a node is successfully opened AFTER the animation completes). </div></div><div class=CToolTip id="tt31"><div class=CFunction>Close a node so that its children are not visible.</div></div><div class=CToolTip id="tt32"><div class=CEvent>This event is triggered in the <b>jstree</b> namespace when a node is closed AFTER the animation completes). </div></div><div class=CToolTip id="tt33"><div class=CFunction>Open all nodes from a certain node down.</div></div><div class=CToolTip id="tt34"><div class=CFunction>Close all nodes from a certain node down.</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>